{% extends "base.html" %}
{% block content_title %}{% endblock %}
{% block content %}
{% if articles %}
    {% for article in articles_page.object_list %}
        {% if loop.length > 0 %}
            {% if loop.first %}
            <section>
                <ol id="posts-list" class="hfeed" start="{{ articles_paginator.per_page -1 }}">
            {% endif %}

                    <article>
                        <header>
                            <h1 class="entry-title">
                                <a href="/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
                                   {{ article.title }}
                                </a>
                            </h1>
                        </header>

                        <div class="entry-content">
                            {% include 'article_infos.html' %}
                            {{ article.content }}
                        </div><!-- /.entry-content -->

                        <hr/>
                    </article>

            {% if loop.last %}
                </ol><!-- /#posts-list -->
                {% if loop.last and (articles_page.has_previous()
                or not articles_page.has_previous() and loop.length > 1) %}
                    {% include 'pagination.html' %}
                {% endif %}
            </section><!-- /#content -->
            {% endif %}
        {% endif %}
    {% endfor %}
{% else %}
<section  >
<h2>Pages</h2>
    {% for page in PAGES %}
        <li><a href="/{{ page.url }}">{{ page.title }}</a></li>
    {% endfor %}
</section>
{% endif %}
{% endblock content %}
